<?php
/**
 * Created by PhpStorm.
 * User: HLG
 * Date: 2018/12/8
 * Time: 17:30
 */
namespace app\admin\controller;
use app\admin\model\AdminModel;
use think\Controller;
use think\Session;
class Login extends Controller
{
    public function index()
    {
        return view('index/index');
    }
    //登录
    public function doLogin()
    {
        if(input('post.')){
            $adminModel = new AdminModel();
            $result = $adminModel->checkLoginUser();
            return $result;
        }else{
            return  view('login/login');
        }

    }
    //退出
    public function out(){
        Session::set('admin_id','');
        return  view('login/login');
    }
    /**
     * 修改密码
     */
    public function loginedit()
    {
        if(input('post.'))
        {
            $admin = new AdminModel();
            $result = $admin->loginedit();
            return $result;
        }else{
            return view('login/loginedit');
        }
    }
}